
#include "chunking.hh"

using namespace std;

Chunker::Chunker(int n) {
     n_=n;
}

Chunker::~Chunker(){ 
  printf("chunking is ok\n");
}


void Chunker::chunking(unsigned char *buffer,int buffersize,int *chunklength,int *left) {
  int n=n_*16;
  if((buffersize%(n_*16))!=0) {
     (*left)=n-(buffersize%(n_*16));
     (*chunklength)=(buffersize+(*left))/n_;
}
    else
{
    (*chunklength)=(buffersize)/n_;
    *left=0;
} 
}
